<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const set1 = new Set([1, 2, 3, 4]);
        console.log(set1);
        set1.forEach(value => {
            console.log(value);
        })
        const setarr = [...set1];
        console.log(setarr);
        setarr.forEach(value => {
            console.log(value);
        })
    </script>
</body>

</html>